
H2 = ["com.h2database:h2:jar:1.3.154"]

HSQL = ['hsqldb:hsqldb:jar:1.8.0.10']

HIBERNATE_VER = "3.3.2.GA"

HIBERNATE_CORE = ["org.hibernate:hibernate-core:jar:#{HIBERNATE_VER}"]
HIBERNATE = [
	"javax.validation:validation-api:jar:1.0.0.GA",
	"org.hibernate:hibernate-validator:jar:4.1.0.Final",
	"org.hibernate:hibernate-validator-annotation-processor:jar:4.1.0.Final",
	"org.hibernate:hibernate-annotations:jar:3.4.0.GA",
	"org.hibernate:hibernate-commons-annotations:jar:3.3.0.ga",
	"commons-dbcp:commons-dbcp:jar:1.4",
	"mysql:mysql-connector-java:jar:5.1.15",
	"org.aspectj:aspectjweaver:jar:1.6.10",
	"org.hibernate:hibernate-search:jar:3.1.0.GA"
]

JAVASSIST = ['javassist:javassist:jar:3.12.1.GA']
LOG4J_VER = "1.5.6"
LOG4J = [
	"log4j:log4j:jar:1.2.16",
    "org.slf4j:slf4j-api:jar:1.5.6",
    "org.slf4j:jcl-over-slf4j:jar:1.5.6",
    "org.slf4j:slf4j-log4j12:jar:1.5.6"
]

SPRING_CORE_VER = "3.0.5.RELEASE"
SPRING_CORE = [
	"org.springframework:spring-webmvc:jar:#{SPRING_CORE_VER}" ,
	"org.springframework:spring-core:jar:#{SPRING_CORE_VER}" ,
	"org.springframework:spring-aop:jar:#{SPRING_CORE_VER}" ,
	"org.springframework:spring-aspects:jar:#{SPRING_CORE_VER}",
	"org.springframework:spring-orm:jar:#{SPRING_CORE_VER}" 
]

SPRING_SECURITY_VERSION = "3.0.5.RELEASE"
SPRING_SECURITY = [
		"org.springframework.security:spring-security-core:pom:#{SPRING_SECURITY_VERSION}",
		"org.springframework.security:spring-security-config:jar:#{SPRING_SECURITY_VERSION}",
		"org.springframework.security:spring-security-acl:pom:#{SPRING_SECURITY_VERSION}",
		"org.springframework.security:spring-security-taglibs:jar:#{SPRING_SECURITY_VERSION}",
		"org.springframework.security:spring-security-web:pom:#{SPRING_SECURITY_VERSION}" ]

SERVLET_API = [ "javax.servlet:servlet-api:jar:2.5", "javax.el:el-api:jar:1.0", "javax.servlet.jsp:jsp-api:jar:2.1", "log4j:log4j:jar:1.2.14"]
JSTL_API = ["javax.servlet:jstl:jar:1.2" ]
JACKSON_CORE = [ 'org.codehaus.jackson:jackson-core-asl:jar:1.7.4','org.codehaus.jackson:jackson-mapper-asl:jar:1.7.4' ]
REMOVE = ["org.slf4j:slf4j-api:jar:1.4.2", "org.hibernate:hibernate-validator:jar:3.1.0.GA","org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final",]

repositories.remote << "http://www.ibiblio.org/maven2/"

#spring
repositories.remote << "http://maven.springframework.org"
repositories.remote << "http://maven.springframework.org/release"
repositories.remote << "http://maven.springframework.org/snapshot"
repositories.remote << "http://maven.springframework.org/milestone"
repositories.remote << "http://maven.springframework.org/nightly"

repositories.remote << "http://repo2.maven.org/maven2/"
repositories.remote << "http://repo1.maven.org/maven2/"
repositories.remote << "http://oss.sonatype.org/content/repositories/sourceforge-releases/net/sf/ehcache/"
repositories.remote << "http://mirrors.ibiblio.org/pub/mirrors/maven2/net/sf/"
repositories.remote << "http://download.java.net/maven/2/"
# hibernate
repositories.remote << "https://repository.jboss.org/nexus/content/groups/public/"
repositories.remote << "https://repository.jboss.org/nexus/content/repositories/snapshots/"
repositories.remote << "http://repository.jboss.org/nexus/content/groups/public-jboss/"
repositories.remote << "http://repo1.maven.org/maven2/mysql/mysql-connector-java/"
repositories.remote << "http://download.java.net/maven/"
repositories.remote << "https://oss.sonatype.org/content/repositories/JBoss"


define "webfit" do
  project.version = '0.1.0'
  compile.with(JSTL_API, JAVASSIST, HSQL, transitive(HIBERNATE_CORE, JACKSON_CORE, SPRING_CORE, LOG4J, HIBERNATE, SERVLET_API).reject {|a| a.id == "jsp-api" || a.id =="jstl" || a.id == "jboss-servlet-api_3.0" || a.group == "org.jboss.javaee"},
        transitive(SPRING_SECURITY) .reject{
		  |a| a.version == '3.0.3.RELEASE' || a.id == 'jcl-over-slf4'||
		    (a.id == 'slf4j-log4j12' && a.version < '1.6.1')
		})
  package :jar
  package(:war).libs -= artifacts(REMOVE, SERVLET_API, JSTL_API)
  #Print out libs
  puts package(:war).libs.map(&:to_spec)
end
